import { h } from 'vue'
import { FormSchema } from '@/components/Table'
import { Tag,Switch } from 'ant-design-vue'
import { useMessage } from '@/hooks/web/useMessage'

export const columns = [
  {
    title: '时间',
    dataIndex: 'receive_time',
    align: 'center',
    width: 180,
    ellipsis: true,
  },
  {
    title: '结冰',
    dataIndex: 'jiebin',
    align: 'center',
    width: 80,
    ellipsis: true,
  },
  {
    title: '水膜',
    dataIndex: 'shuimo',
    align: 'center',
    width: 80,
    ellipsis: true,
  },
  {
    title: '积雪',
    dataIndex: 'jixue',
    align: 'center',
    width: 80,
    ellipsis: true,
  },
  {
    title: '温度',
    dataIndex: 'wendu',
    align: 'center',
    width: 80,
    ellipsis: true,
  },
  {
    title: '湿度',
    dataIndex: 'shidu',
    align: 'center',
    width: 80,
    ellipsis: true,
  },{
    title: '能见度',
    dataIndex: 'nengjiandu',
    align: 'center',
    width: 80,
    ellipsis: true,
  },{
    title: '光强',
    dataIndex: 'guangqiang',
    align: 'center',
    width: 80,
    ellipsis: true,
  },{
    title: '风速',
    dataIndex: 'fengsu',
    align: 'center',
    width: 80,
    ellipsis: true,
  },
  {
    title: '电流',
    dataIndex: 'dianliu',
    align: 'center',
    width: 80,
    ellipsis: true,
  },
  {
    title: '风向',
    dataIndex: 'fengxiang',
    align: 'center',
    width: 80,
    ellipsis: true,
  },{
    title: 'PM2.5',
    dataIndex: 'pm25',
    align: 'center',
    width: 80,
    ellipsis: true,
  },{
    title: 'PM1.0',
    dataIndex: 'pm10',
    align: 'center',
    width: 80,
    ellipsis: true,
  },{
    title: '雨量',
    dataIndex: 'yuliang',
    align: 'center',
    width: 80,
    ellipsis: true,
  },{
    title: '雨强',
    dataIndex: 'yuqiang',
    align: 'center',
    width: 80,
    ellipsis: true,
  },{
    title: '光电',
    dataIndex: 'guangdian',
    align: 'center',
    width: 80,
    ellipsis: true,
  },
  {
    title: '风电',
    dataIndex: 'fengdian',
    align: 'center',
    width: 80,
    ellipsis: true,
  },{
    title: '压电',
    dataIndex: 'yadian',
    align: 'center',
    width: 80,
    ellipsis: true,
  },{
    title: '电压',
    dataIndex: 'dianya',
    align: 'center',
    width: 80,
    ellipsis: true,
  },{
    title: '校准值',
    dataIndex: 'correct',
    align: 'center',
    width: 80,
    ellipsis: true,
  },
]

export const searchFormSchema: FormSchema[] = [
  {
    field: 'keyword',
    label: '关键词',
    component: 'Input',
    componentProps: {
      placeholder: '请输入关键词',
      autoComplete: 'off',
    },
    colProps: { span: 6 },
  },
]

export const formSchema = [
  {
    field: 'title',
    label: '名称',
    component: 'Input',
    defaultValue: '',
    componentProps: {
      placeholder: '请输入名称',
    },
    colProps: { span: 24 },
    required: true,
  },
  {
    field: 'sort',
    label: '排序',
    component: 'InputNumber',
    defaultValue: 0,
    componentProps: {
      placeholder: '请输入排序',
    },
    colProps: { span: 24 },
    required: false,
  },
  {
    field: 'description',
    label: '描述',
    component: 'InputTextArea',
    defaultValue: '',
    componentProps: {
      placeholder: '请输入描述',
    },
    colProps: { span: 24 },
    required: false,
  },
  {
    field: 'status',
    label: '状态',
    component: 'RadioButtonGroup',
    defaultValue: 'enable',
    componentProps: {
      options: [
        { label: '正常', value: 'enable', },
        { label: '禁用', value: 'disable', }
      ],
    },
    colProps: { span: 24 },
    required: false,
  },
];
